package com.ilongge.rank.Utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Properties;

public final class PropertiesUtil
{
    private static final Logger LOGGER = LoggerFactory.getLogger(PropertiesUtil.class);
    
    public static Properties readProperties(String filename)
    {
        InputStream propIS = PropertiesUtil.class.getClassLoader().getResourceAsStream(filename);
        Properties properties = new Properties();
        try
        {
            properties.load(new InputStreamReader(propIS, "UTF-8"));
        }
        catch (IOException e)
        {
            LOGGER.error("classpath下沒有找到配置文件:" + filename);
        }
        return properties;
    }
}
